﻿<?php


$obj=new mysql($config);

$sql="select * from `author` where pid=0";
$date=$obj->getCondition($sql);
// foreach ($date as $k => $v) {
	
// }
// print_r($date);


if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
   echo json_encode($date);
   die;
}



if(!empty($_POST)){

    $row=$obj->insert($_POST,'author');
    if($row){
        echo '<script>alert("添加成功");</script>';
    }else{
        echo '<script>alert("添加失败");</script>';
    }
}









require_once (VIEW_PATH.'admin/layout.html');

